(function($) {
    $.extend($.fn,{
        mainmenu:function(settings){
            ;
            //setting,
            settings=$.extend(settings,{click:itemclick});
            this.settings=settings;

            function itemclick(e){
                console.log(e);
                ;}
            //console.log(this,$.fn.treeview.apply);
            $(this).treeview(this.settings);
            //$.fn.treeview.apply(this,{click:itemclick});
            return this;
            ;}
        })
        })(jQuery);


$(document).ready(function(){
	var mm=$(".mm2").mainmenu();
    mm.insertItem('inset menu',2);
    mm.insertTree(['sub item1','sub item2'],2)


});
